<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
    <title>Registration</title>
</h:head>

<h:body>

    <ui:composition template="/common/template/layout.xhtml">

        <ui:define name="content">

            <h:form>

                <p:panelGrid>
                    <f:facet name="header">
                        <p:row colspan="30">
                                <p:column colspan="30">Create A Trip</p:column>
                        </p:row>
                    </f:facet>

                    <p:row>
                        <p:column>
                            <h:outputLabel for="tripTransportId" value="Transport: " />
                        </p:column>

                        <p:column>
                            <p:selectOneMenu id="tripTransportId" value="#{tripActionHelper.tripTransportId}" required="true" label="Transport">
                                <f:selectItem itemLabel="Select" itemValue="" />
                                <f:selectItems value="#{transportAction.transportNameIdMap}" />
                            </p:selectOneMenu> <br/>
                            <h:message for="tripTransportId" style="color:red; font-size: 12px;"/>
                        </p:column>
                    </p:row>

                    <p:row>
                            <p:column>
                                <h:outputLabel for="routeName" value="Route: " />
                            </p:column>

                            <p:column>
                                <p:selectOneMenu id="routeName" value="#{tripActionHelper.route}" required="true" label="Route">
                                    <f:selectItem itemLabel="Select" itemValue="" />
                                    <f:selectItems value="#{routeAction.routeRouteMap}" />
                                </p:selectOneMenu> <br/>

                                <h:message for="routeName" style="color:red; font-size: 12px;"/>
                            </p:column>
                    </p:row>

                    <p:row>
                        <p:column>
                            <h:outputLabel for="tripTime" value="Trip Time: " />
                        </p:column>

                        <p:column>
                                <p:calendar id="tripTime" value="#{tripActionHelper.tripTime}" pattern="MM/dd/yyyy HH:mm" rendered="true" label="Trip Time"/> <br/>
                                <h:message for="tripTime" style="color:red; font-size: 12px;"/>
                            </p:column>
                    </p:row>

                    <f:facet name="footer">
                        <p:row>
                            <p:column colspan="30">
                                <h:commandButton action="#{tripActionHelper.createTrip}" value="Create"/>
                            </p:column>
                        </p:row>
                    </f:facet>
                </p:panelGrid>

            </h:form>

        </ui:define>

    </ui:composition>

</h:body>

</html>